//
//@File    :	4.21_newstrct.cpp
//@Time    :	2021/08/04 17:08:40
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using new with a structure
//

#include <iostream>
struct inflatable
{
    char name[20];
    float volume;
    double price;
};
int main()
{
    using namespace std;
    inflatable *ps = new inflatable;
    cout<<"Enter name of inflatable item:";
    cin.get(ps->name,20);
    cout<<"Enter volume in cubic feet:";
    cin>>(*ps).volume;
    cout<<"Enter price:$";
    cin>>ps->price;
    cout<<"Name: "<<(*ps).name<<endl;
    cout<<"Volume:"<<ps->volume<<" cubic feet\n";
    cout<<"Price:$"<<ps->price<<endl;
    delete ps;
    system("pause");
    return 0;
}